<% lineconst = 8%>
<% linenum = bigcommlist.size/lineconst%>
<% leftnum = bigcommlist.size%lineconst%>
<table>
<% for i in 0...linenum
%>
     <tr>
     <% for j in 0...lineconst
     %>
       <td>
       <%= link_to "#{bigcommlist[i*lineconst+j].title}(#{bigcommlist[i*lineconst+j].users.size})", community_path(bigcommlist[i*lineconst+j].district, bigcommlist[i*lineconst+j]) %>
       </td>
     <%
     end
     %>
     </tr>
<%
   end
%>
<% if leftnum > 0%>
  <tr>
  <% for i in 0...leftnum%>
    <td>
    <%= link_to "#{bigcommlist[linenum*lineconst+i].title}(#{bigcommlist[linenum*lineconst+i].users.size})", community_path(bigcommlist[linenum*lineconst+i].district, bigcommlist[linenum*lineconst+i]) %>
    </td>
  <% end %>
  <% for i in 0...(lineconst-leftnum)%>
    <td>
    &nbsp;
    </td>
  <% end %>
  </tr>
<% end %>
</table>
<% if @communities.size > 0 -%>
<%= will_paginate_remote @communities, :class => 'small_pagination', :url => {:controller => "districts", :action => "ajaxbigshowcomm", :id => bigcommlist[0].district}, :loading => "Element.hide('communities_div'), Element.show('loading-gif')", :complete => "Element.show('communities_div'), Element.hide('loading-gif')", :update=>"communities_div" %>
<% end -%>
